package com.thinkgem.jeesite.modules.book.entity;

import com.thinkgem.jeesite.common.persistence.DataEntity;

import java.util.Date;
import java.util.List;

/**
 * Created by aulbrother on 2015/11/30.
 */
public class BkPurchaseBatch extends DataEntity<BkPurchaseBatch>{
    public static final String STATUS_CANCEL = "cancel";
    public static final String STATUS_OK = "ok";
    public static final String STATUS_PLAN = "plan";
    public static final String STATUS_OVER = "confirm";
    public static final String STATUS_CHECK = "check";
    public static final String STATUS_WORK = "work";
    private int batchId;
    private String batchNumber;
    private String invoice;// 发票号
    private Date planDate;
    private Date batchDate;
    private String beginDate;
    private String endDate;
    // 码洋
    private double fixedPrice;
    // 实洋
    private double discountedPrice;
    private String remarks;
    private String status;
    private List<BkPurchaseBatchDetail> details;

    public BkPurchaseBatch(){

    }

    public BkPurchaseBatch(String batchNumber, Date planDate, String remarks, String status){
        this.batchNumber = batchNumber;
        this.planDate = planDate;
        this.remarks = remarks;
        this.status = status;
    }

    public Date getPlanDate(){
        return planDate;
    }

    public void setPlanDate(Date planDate){
        this.planDate = planDate;
    }

    public double getFixedPrice(){
        return fixedPrice;
    }

    public void setFixedPrice(double fixedPrice){
        this.fixedPrice = fixedPrice;
    }

    public double getDiscountedPrice(){
        return discountedPrice;
    }

    public void setDiscountedPrice(double discountedPrice){
        this.discountedPrice = discountedPrice;
    }

    public String getBatchNumber(){
        return batchNumber;
    }

    public void setBatchNumber(String batchNumber){
        this.batchNumber = batchNumber;
    }

    public String getBeginDate(){
        return beginDate;
    }

    public void setBeginDate(String beginDate){
        this.beginDate = beginDate;
    }

    public String getEndDate(){
        return endDate;
    }

    public void setEndDate(String endDate){
        this.endDate = endDate;
    }

    public int getBatchId(){
        return batchId;
    }

    public void setBatchId(int batchId){
        this.batchId = batchId;
    }

    public Date getBatchDate(){
        return batchDate;
    }

    public void setBatchDate(Date batchDate){
        this.batchDate = batchDate;
    }

    public String getRemarks(){
        return remarks;
    }

    public void setRemarks(String remarks){
        this.remarks = remarks;
    }

    public List<BkPurchaseBatchDetail> getDetails(){
        return details;
    }

    public void setDetails(List<BkPurchaseBatchDetail> details){
        this.details = details;
    }

    public String getStatus(){
        return status;
    }

    public void setStatus(String status){
        this.status = status;
    }

    public String getInvoice(){
        return invoice;
    }

    public void setInvoice(String invoice){
        this.invoice = invoice;
    }

    @Override
    public boolean equals(Object o){
        if(this == o) return true;
        if(o == null || getClass() != o.getClass()) return false;

        BkPurchaseBatch that = (BkPurchaseBatch)o;

        if(batchId != that.batchId) return false;
        if(batchDate != null ? !batchDate.equals(that.batchDate) : that.batchDate != null) return false;
        if(remarks != null ? !remarks.equals(that.remarks) : that.remarks != null) return false;
        if(batchNumber != null ? !batchNumber.equals(that.batchNumber) : that.batchNumber != null) return false;
        if(status != null ? !status.equals(that.status) : that.status != null) return false;

        return true;
    }

    @Override
    public int hashCode(){
        int result = batchId;
        result = 31 * result + (batchDate != null ? batchDate.hashCode() : 0);
        result = 31 * result + (remarks != null ? remarks.hashCode() : 0);
        return result;
    }
}
